package com.waitingresult;

import java.io.File;

/**
 * @Author: WangShuai
 * @CreateTime: 2024/03/06  16:54
 * @Description:
 * @Version: 1.0
 */
public class FileMain {
    public static void main(String[] args) {
        File directory = new File("D:\\cache\\jsonFile");
        if (directory.isFile()) {
            System.out.println(directory.getName());
        }else if(directory.isDirectory()){
            File[] files = directory.listFiles();
            System.err.println(files);
        }
    }

    private static void extracted(File directory) {
        if (directory.getName().startsWith(".") || directory.getName().endsWith(".sample")) {
            return;
        }
        if (directory.isFile()) {
            System.out.println(directory.getName());
        } else if (directory.isDirectory()) {
            for (File file : directory.listFiles()) {
                extracted(file);
            }
        }
    }
}
